package dialer.ws.base.entity;

import java.io.Serializable;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "agent", schema = "call_center")
@NamedQueries({ @NamedQuery(name = "getAgentByState", query = "from Agent where estatus=:estatus") })
public class Agent implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1820582887551860953L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "id", unique = true, nullable = false)
	private Integer id;

	@Column(name = "number", nullable = false)
	private String number;

	@Column(name = "name", nullable = false)
	private String name;

	@Column(name = "password", nullable = false)
	private String password;

	@Column(name = "estatus", length = 1)
	private String estatus;

	@Column(name = "eccp_password")
	private String eccpPassword;

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "agent")
	private List<CurrentCallEntry> listCurrentCallEntry;

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "agent")
	private List<Calls> listCalls;

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "agent")
	private List<Audit> listAudit;

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "agent")
	private List<CallEntry> listCallEntriy;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getNumber() {
		return number;
	}

	public void setNumber(String number) {
		this.number = number;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getEstatus() {
		return estatus;
	}

	public void setEstatus(String estatus) {
		this.estatus = estatus;
	}

	public String getEccpPassword() {
		return eccpPassword;
	}

	public void setEccpPassword(String eccpPassword) {
		this.eccpPassword = eccpPassword;
	}

	public List<CurrentCallEntry> getListCurrentCallEntry() {
		return listCurrentCallEntry;
	}

	public void setListCurrentCallEntry(List<CurrentCallEntry> listCurrentCallEntry) {
		this.listCurrentCallEntry = listCurrentCallEntry;
	}

	public List<Calls> getListCalls() {
		return listCalls;
	}

	public void setListCalls(List<Calls> listCalls) {
		this.listCalls = listCalls;
	}

	public List<Audit> getListAudit() {
		return listAudit;
	}

	public void setListAudit(List<Audit> listAudit) {
		this.listAudit = listAudit;
	}

	public List<CallEntry> getListCallEntriy() {
		return listCallEntriy;
	}

	public void setListCallEntriy(List<CallEntry> listCallEntriy) {
		this.listCallEntriy = listCallEntriy;
	}

}
